<include file="Public/header" />
  
  <body>
  <div class="layui-container" style="margin-top: 10px;">
    <div class="layui-row">
      <div class="layui-col-md12">        
        <form class="layui-form" action="__URL__/do_seladd" method="post">
            <div class="layui-form-item">
              <label class="layui-form-label">选课项目名称</label>
              <div class="layui-input-block">
                <input type="text" name="title" required  lay-verify="required" placeholder="请输入选课项目名称" autocomplete="off" class="layui-input" id="title">
              </div>
            </div>
             <div class="layui-form-item">
              <label class="layui-form-label">学校</label>
              <div class="layui-input-block">
                <select name="schoolid" lay-verify="required" id="schoolid">
                  <option value="">请选择读学校</option>
                   <if condition="$Think.session.type eq 2 ">
                  <option value="1">孝义中学</option>
                  <option value="2">孝义二中</option>
                  <option value="3">孝义三中</option>
                  <option value="4">孝义四中</option>
                  <option value="5">孝义五中</option>
                  <option value="6">孝义实验中学</option>
                  <option value="7">孝义华杰中学</option>
                  <option value="8">孝义艺苑中学</option>
                  <else/>
                  <option value="<{$Think.session.schoolid}>"><{$Think.session.schoolid|getschool}></option>
                  </if>
                </select>
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">学生届别</label>
              <div class="layui-input-block">
                <select name="year" lay-verify="required" id="year">
                  <option value="">请选择学生届别</option>
                  <option value="2010">2010届测试</option>
                  <option value="2016">2016届</option>
                  <option value="2017">2017届</option>
                  <option value="2018">2018届</option>
                </select>
              </div>
            </div>
            <div class="layui-form-item">
              <label class="layui-form-label">选课组合</label>
                <div class="layui-input-block">
                   <input type="checkbox" name="allowgroup[]" title="物化生" id="allowgroup" value="物化生">
                   <input type="checkbox" name="allowgroup[]" title="物化政" id="allowgroup" value="物化政">
                   <input type="checkbox" name="allowgroup[]" title="物化史" id="allowgroup" value="物化史">
                   <input type="checkbox" name="allowgroup[]" title="物化地" id="allowgroup" value="物化地">
                   <input type="checkbox" name="allowgroup[]" title="物生政" id="allowgroup" value="物生政">
                   <input type="checkbox" name="allowgroup[]" title="物生史" id="allowgroup" value="物生史">
                   <input type="checkbox" name="allowgroup[]" title="物生地" id="allowgroup" value="物生地">
                   <input type="checkbox" name="allowgroup[]" title="物政史" id="allowgroup" value="物政史">
                   <input type="checkbox" name="allowgroup[]" title="物政地" id="allowgroup" value="物政地">
                   <input type="checkbox" name="allowgroup[]" title="物史地" id="allowgroup" value="物史地">
                   <input type="checkbox" name="allowgroup[]" title="化生政" id="allowgroup" value="化生政">
                   <input type="checkbox" name="allowgroup[]" title="化生史" id="allowgroup" value="化生史">
                   <input type="checkbox" name="allowgroup[]" title="化生地" id="allowgroup" value="化生地">
                   <input type="checkbox" name="allowgroup[]" title="化政史" id="allowgroup" value="化政史">
                   <input type="checkbox" name="allowgroup[]" title="化政地" id="allowgroup" value="化政地">
                   <input type="checkbox" name="allowgroup[]" title="化史地" id="allowgroup" value="化史地">
                   <input type="checkbox" name="allowgroup[]" title="生政史" id="allowgroup" value="生政史">
                   <input type="checkbox" name="allowgroup[]" title="生史地" id="allowgroup" value="生史地">
                   <input type="checkbox" name="allowgroup[]" title="生政地" id="allowgroup" value="生政地">
                   <input type="checkbox" name="allowgroup[]" title="政史地" id="allowgroup" value="政史地">
                </div>
            </div>
             <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">选课说明</label>
                <div class="layui-input-block">
                  <textarea class="layui-textarea layui-hide" name="description" lay-verify="content" id="LAY_demo_editor">
                  </textarea>
                </div>
            </div>
            <!-- <hr class="layui-bg-green"> -->
            <div class="layui-form-item">
              <div class="layui-input-block">
              <!-- <a class="layui-btn" href="javascript:;" lay-submit onclick="sub('<{$te.tid}>')">立即提交</a> -->
              <!-- <button class="layui-btn" lay-submit onsubmit="sub('<{$te.tid}>')">立即提交</button> -->
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
              </div>
            </div>
          </form>
        </div>
    </div>
</div> 
<script>

// //Demo
layui.use(['form', 'layedit'], function(){
  var form = layui.form
  ,layedit = layui.layedit;
  var editIndex = layedit.build('LAY_demo_editor',{
      tool: ["strong","left","center","right","|","link","face","code"]
      ,height: 100,
      width:200
      });
        
  //监听提交
  // form.on('submit(formDemo)', function(){
  //   // layer.msg(JSON.stringify(data.field));
  //   //alert(data.field.tname);
  //   var title=$('#title').val(),schoolid=$('#schoolid').val(),allowgroup=$('#allowgroup').val();
  //   alert(allowgroup);
  //   $.post("<{:U('do_seladd')}>",{title:title,schoolid:schoolid,allowgroup:allowgroup},function(data,status){
  //         alert("Data: " + data + "\nStatus: " + status);
  //         // if (data >= 1) {
  //         //   layer.msg('添加成功!',{icon: 6,time:2000});
  //         //   setTimeout("x_admin_close()",1000);
  //         //   setTimeout("window.parent.location.reload()",1000);
  //         // } else{
  //         //   layer.msg('添加失败，请重试！或联系管理员！',{icon: 5,time:1000});
  //         //   //x_admin_close();
  //         // } 
  //     });
  //   return false;
  // });
});

</script>
</body>
</html>